<!-- 计分方式：明尼苏达多相个性测验(MMPI) 个人 -->

<!-- 报告名称 -->
<h2>{$qaMain['title']}</h2>

<!-- 问答人信息 -->
<div class="top_info">
    {if $wxapp < 1} <div class="nowrap left" style="width: 50%;">测&ensp;评&ensp;人：{$data['userName']}</div>
<div class="nowrap left" style="width: 25%;">性&emsp;&emsp;别：{$data['sex']}</div>
<div class="nowrap left" style="width: 25%;">年&emsp;&emsp;龄：{$data['age']}</div>
{/if}
<div class="nowrap left" style="width: 50%;">问答单位：{$asOrder['team_name']}</div>
<div class="nowrap left" style="width: 50%;">问答时间：{$asRecord['update_time']}</div>
</div>

<!-- 评估标准 -->
<div>
    <p>{$qaMain['standard']}</p>
</div>

<!-- 因子得分 剖析图 -->
{notempty name="data.resultItems"}

<div class="bar_chart">
    <div id="lineChart" style="width: 100%;height:300px;"></div>
</div>

<!-- 因子得分 表格 -->
{if $wxapp < 1} <div class="classify_score_table">
    <table class="table" border="1" cellpadding="3" cellspacing="1">
        <tr>
            <th valign="bottom">因子</th>
            {foreach $data.resultItems as $key=>$vo }
            <th valign="bottom">{$vo['因子名称']}</td>
                {/foreach}
        </tr>
        <tr>
            <th>得分</th>
            {foreach $data.resultItems as $key=>$vo }
            <td class="nowrap" style="color: {$vo.color};">{$vo['因子']=='Q'?$vo['原始分']:$vo['T分']}</td>
            {/foreach}
        </tr>
    </table>
    </div>
    {else /}

    <div class="classify_score_table">
        <table class="table" border="1" cellpadding="3" cellspacing="1">
            <tr>
                <th>因子</th>
                <th class="nowrap" width="20%">得分</th>
            </tr>
            {foreach $data.resultItems as $key=>$vo }
            <tr>
                <td>{$vo['因子名称']}</td>
                <td class="nowrap" style="color: {$vo.color};">{$vo['因子']=='Q'?$vo['原始分']:$vo['T分']}</td>
            </tr>
            {/foreach}
        </table>
    </div>
    {/if}
    {/notempty}

    <ul class="report-list">
        {foreach $data.resultItems as $key=>$vo }
        <li class="factor">
            <div>
                <b style="margin-top:0;text-align: left;color: {$vo.color};">{$vo.lable}</b>
            </div>
            <div class="result_msg">{$vo.text}</div>
        </li>
        <hr>
        {/foreach}
    </ul>

    <!-- 问答介绍 -->
    <div style="margin-top: 2em;">
        <p>{$qaMain['content']}</p>
    </div>


    <!-- 公众号 客服号 [二维码入口] -->
    <div class="qr_img_list">
        <div>
            <img src="{$data['companyInfo']['img_wx_official']}">
            <div>公众号</div>
        </div>
        <div>
            <img src="{$data['companyInfo']['img_wx_service']}">
            <div>公众号</div>
        </div>
    </div>

    <script type="text/javascript">
        $(function () {
            // 基于准备好的dom，初始化echarts实例
            var lineChart = echarts.init(document.getElementById('lineChart'), null, {
                // renderer: 'canvas',
                renderer: 'svg',
                useDirtyRect: false
            });

            var lineChartOption = {
                title: {
                    text: '剖析图',
                    subtext: '',
                    left: 'center'
                },
                xAxis: {
                    type: 'category',
                    data: $.parseJSON('{$data["categoryJson"]}'),
                    // max: 100,
                    axisLabel: {
                        rotate: 45
                    }
                },
                yAxis: {
                    type: 'value'
                },
                series: [{
                    data: $.parseJSON('{$data["seriesJson"]}'),
                    type: 'line',
                    markLine: {
                        silent: true,
                        lineStyle: {
                            color: '#FF722C'
                        },
                        data: [
                            {
                                yAxis: 40
                            },
                            {
                                yAxis: 60
                            }
                        ]
                    }
                }]
            };

            // 使用刚指定的配置项和数据显示图表。
            lineChart.setOption(lineChartOption);

            // 使用刚指定的配置项和数据显示图表。
            barChart.setOption(barChartOption);
        });
    </script>

    <style>
        .classify_score_table {
            padding: 10px 8px;
        }

        .classify_score_table table {
            width: 100%;
            text-align: center;
            border-collapse: collapse;
        }

        .classify_score_table table th {
            background-color: lightgray;
            font-weight: normal;
            width: 1.5em;
        }
    </style>